exports.data = {
  json: {
    kind: "Snippet",
    body: ['"t-image": "tdesign-miniprogram/image/image"'],
    detail: "Image 图片",
    documentation: `在app.json或index.json中引入组件`,
  },
  wxml: {
    kind: "Snippet",
    body: ['<t-image src="${1}" mode="${2}"/>'],
    detail: "Image 图片",
    documentation: `增强版的 img 标签，提供多种图片填充模式，支持图片懒加载、加载中提示、加载失败提示。`,
    attrs: [
      {
        kind: "Field",
        body: ["t-id="],
        detail: "t-id",
        documentation: "按钮标签id",
        vals: null,
      },
      {
        kind: "Field",
        body: ["src="],
        detail: "src",
        documentation: "图片链接",
        vals: null,
      },
      {
        kind: "Field",
        body: ["shape="],
        detail: "shape",
        documentation: "图片圆角类型。可选项：circle/round/square",
        vals: {
          kind: "Value",
          body: ["circle", "round", "square"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["width="],
        detail: "width",
        documentation: "宽度，默认单位为px",
        vals: null,
      },
      {
        kind: "Field",
        body: ["height="],
        detail: "height",
        documentation: "高度，默认单位为px",
        vals: null,
      },
      {
        kind: "Field",
        body: ["error="],
        detail: "error",
        documentation:
          "加载失败时显示的内容。值为 default 则表示使用默认加载失败风格；值为空或者 slot 表示使用插槽渲染，插槽名称为 error；值为其他则表示普通文本内容，如“加载失败”",
        vals: null,
      },
      {
        kind: "Field",
        body: ["loading="],
        detail: "loading",
        documentation:
          "加载态内容。值为 default 则表示使用默认加载中风格；值为其他则表示普通文本内容，如“加载中”",
        vals: null,
      },

      {
        kind: "Field",
        body: ["mode="],
        detail: "mode",
        documentation: "图片填充模式",
        vals: {
          kind: "Value",
          body: [
            "scaleToFill",
            "aspectFit",
            "aspectFill",
            "widthFix",
            "heightFix",
            "top",
            "bottom",
            "center",
            "left",
            "right",
            "top left",
            "top right",
            "bottom left",
            "bottom right",
          ],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["alt="],
        detail: "alt",
        documentation: "",
        vals: null,
      },
      {
        kind: "Field",
        body: ["lazy"],
        detail: "lazy",
        documentation: "是否懒加载",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["webp"],
        detail: "webp",
        documentation: "是否解析 webp 格式默认不解析 webP 格式，只支持网络资源",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },
      {
        kind: "Field",
        body: ["show-menu-by-longpress"],
        detail: "show-menu-by-longpress",
        documentation:
          "长按图片显示发送给朋友、收藏、保存图片、搜一搜、打开名片/前往群聊/打开小程序（若图片中包含对应二维码或小程序码）的菜单。",
        vals: {
          kind: "Value",
          body: ["true", "false"],
          detail: "",
          documentation: "",
        },
      },

      /**
         * Events
          事件名	说明	回调参数
          bind:click	点击图片时触发	event: Event
          bind:load	图片加载完毕时触发	event: Event
          bind:error	图片加载失败时触发	event: Event
         */
      {
        kind: "Event",
        body: ["bind:click"],
        detail: "bind:click",
        documentation: "点击图片时触发",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:load"],
        detail: "bind:load",
        documentation: "图片加载完毕时触发",
        vals: null,
      },
      {
        kind: "Event",
        body: ["bind:error"],
        detail: "bind:error",
        documentation: "图片加载失败时触发",
        vals: null,
      },

      /**
         * 外部样式类
          类名	说明
          custom-class	根节点样式类
          image-class	图片样式类
          loading-class	loading 样式类
          error-class	error 样式类
         */
      {
        kind: "Field",
        body: ["t-class="],
        detail: "t-class",
        documentation: "根节点样式类",
        vals: null,
      },
      {
        kind: "Field",
        body: ["t-class-load="],
        detail: "t-class-load",
        documentation: "图片样式类",
        vals: null,
      },
    ],
    /**
       * Slots
        名称	说明
        loading	自定义加载中的提示内容
        error	自定义加载失败时的提示内容
       */
    slot: {
      kind: "Value",
      body: ["loading", "error"],
      detail: "Image 图片 Slot",
      documentation: `
        loading	自定义加载中的提示内容
        error	自定义加载失败时的提示内容
        `,
      vals: null,
    },
  },
};
